﻿using System.Windows.Input;

namespace Toybox.SCM.ViewModels.Config
{
	using Models;
	using Models.Accounts;
	using NicoSharp.Abstracts;

	public class VM_GroupSettingTabItem : AbstractNotifyObject
	{

		#region Public Members

		/// <summary>
		/// Groups
		/// </summary>
		public AccountGroupCollection Groups
		{
			get { return this._groups; }
			set
			{
				if (this._groups == value) return;
				this._groups = value;
				base.OnPropertyChanged("Groups");
			}
		}
		private AccountGroupCollection _groups;

		#endregion Public Members


		#region Commands

		public ICommand AddGroup
		{
			get
			{
				return this._addGroup ?? (this._addGroup = new RelayCommand((_) =>
				{
					var group = new AccountGroup(StaticData.Accounts);

					this.Groups.Add(group);
				}, (_) =>
				{
					return true;
				}));
			}
		}
		private ICommand _addGroup;

		#endregion Commands

	}
}
